import React, { useState } from "react";
import { createModel } from 'hox';

/* 任意一个 custom Hook */
function useCounter() {
    const [count, setCount] = useState(0);
    const decrement = () => setCount(count - 1);
    const increment = () => setCount(count + 1);
    return {
        count,
        decrement,
        increment
    };
}

export default createModel(useCounter)